import type { StorybookConfig } from '@storybook/react-webpack5';
import path from 'path';

const config: StorybookConfig = {
  "stories": [
    "../src/**/*.mdx",
    "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
  ],
  "addons": [
    "@storybook/addon-actions", // 启用 actions
    '@storybook/addon-docs', // 启用 docs
    "@storybook/addon-essentials",
    "@storybook/preset-create-react-app",
    "@storybook/addon-onboarding",
    "@chromatic-com/storybook",
    "@storybook/addon-interactions"
  ],
  "framework": {
    "name": "@storybook/react-webpack5",
    "options": {}
  },
  "staticDirs": [
    "..\\public"
  ],
  // "webpackFinal": async (config) => {
  //   // 确保 Webpack 能够解析 @fortawesome/react-fontawesome
  //   if (config.resolve) {
  //     config.resolve.alias = {
  //       ...config.resolve.alias,
  //       "@fortawesome/react-fontawesome": path.resolve(
  //         __dirname,
  //         "../node_modules/@fortawesome/react-fontawesome"
  //       ),
  //       "@fortawesome/fontawesome-svg-core": path.resolve(
  //         __dirname,
  //         "../node_modules/@fortawesome/fontawesome-svg-core"
  //       ),
  //       "@fortawesome/free-solid-svg-icons": path.resolve(
  //         __dirname,
  //         "../node_modules/@fortawesome/free-solid-svg-icons"
  //       ),
  //     };
  //   }
  //   return config;
  // }
};
export default config;